/**
 * 
 */
package com.googlecode.wmlynar.gwtbeans.xml;

import java.io.IOException;

import org.apache.xerces.parsers.SAXParser;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

import com.googlecode.wmlynar.gwtbeans.gen.Mappings;

/**
 * @author Wojciech Mlynarczyk (woj)
 * 
 */
public class MappingsXmlReader {
    public Mappings read(final String file) throws IOException, SAXException {

        final MappingsContentHandler handler = new MappingsContentHandler();

        final XMLReader parser = new SAXParser();
        parser.setContentHandler(handler);
        parser.parse(file);

        return handler.getMappings();

    }

}
